package demo.pattern.proxy.statics;

import demo.pattern.proxy.Payment;

public class ToCPaymentProxy implements Payment {

	private Payment payment;

	public ToCPaymentProxy(Payment payment) {
		this.payment = payment;
	}

	@Override
	public void pay() {
		beforePay();
		payment.pay();
		afterPay();
	}

	private void afterPay() {
		System.out.println("支付之后");
	}

	private void beforePay() {
		System.out.println("支付之前");
	}

}
